<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="service.serviceimpl.ServiceUserImpl" %>
<%@ page import="entity.Userinfo" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        form {
            display: block;
            width: 400px;
            margin: auto;
        }
    </style>
</head>
<body>


<form method="get" action="${pageContext.request.contextPath}/ServletTest3">
    <%--    隐藏域--%>
    <input type="hidden" name="op" value="update2">
    <input type="hidden" name="id" value="${id}">
    <table border="4">
        <c:forEach items="${list}" var="userinfos">
            <tr>
                <th>修改人员</th>
            </tr>
            <tr>
                <th>姓名</th>
                <th><input type="text" value="${userinfos.name}" name="name"></th>
            </tr>
            <tr>
                    <%--            因为默认k-v 只要name -value--%>
                <th>性别</th>
                <th><input type="radio"  ${userinfos.sex==1?"checked":""} name="sex" value="1">男
                    <input type="radio" ${userinfos.sex==2?"checked":""} name="sex" value="2">女
                </th>
            </tr>
            <tr>
                <th>部门</th>
                <th>
                    <select name="dept">
                        <option ${userinfos.dept.equals("总裁")?"selected":""} value="总裁">总裁</option>
                        <option ${userinfos.dept.equals("经理")?"selected":""} value="经理">经理</option>
                        <option ${userinfos.dept.equals("前台")?"selected":""} value="前台">前台</option>
                    </select>
                </th>
            </tr>
            <tr>
                <th><input type="submit" value="提交"></th>

            </tr>
        </c:forEach>
    </table>

</form>
</body>
</html>
